<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../../common/include.inc.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="admin/role/list"
		method="post">
	<input type="hidden" name="pageNum" value="${page.pageNo }" />
	<input type="hidden" name="numPerPage" value="${page.pageSize }" />
	<input type="hidden" name="orderField" value="" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>角色ID：</td>
					<td><input type="text" name="roleId" value="${page.condition.roleId }" /></td>

					<td>角色名：</td>
					<td><input type="text" name="roleName" value="${page.condition.roleName }" /></td>
					
					<td>角色描述：</td>
					<td><input type="text" name="description" value="${page.condition.description }" /></td>
				</tr>

			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div>
					</li>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button onclick="formReSet(this)" type="button">重置</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="admin/role/add" target="dialog" title="添加角色" rel="roleAddDialog" width="400"><span>添加</span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="60%" layoutH="180">
		<thead>
			<tr>
				<th width="40">序号</th>
				<th width="80">角色ID</th>
				<th width="80">角色描述</th>
				<th width="80">角色名</th>
				<th width="80">操作</th>
			</tr>
		</thead>
		<tbody>
			<%
				int i = 0;
			%>
			<c:forEach var="role" items="${page.list}">
				<tr>
					<td><%=++i%></td>
					<td><c:out value="${role.roleId}"></c:out></td>
					<td><c:out value="${role.description}"></c:out></td>
					<td><c:out value="${role.roleName}"></c:out></td>
					<td>
						<a href="admin/role/deleteRole?roleId=${role.roleId }" target="ajaxTodo" class="btnDel" title="确定要删除角色【${role.roleName }】吗？">删除</a>
					 	<a href="admin/role/modifyRole?roleId=${role.roleId } " target="dialog" title="编辑角色" rel="editRole" class="btnEdit">编辑</a>
					 </td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="10" <c:if test="${page.pageSize==10 }">selected</c:if>>10</option>
				<option value="20" <c:if test="${page.pageSize==20 }">selected</c:if>>20</option>
				<option value="50" <c:if test="${page.pageSize==50 }">selected</c:if>>50</option>
				<option value="100" <c:if test="${page.pageSize==100 }">selected</c:if>>100</option>
				<option value="200" <c:if test="${page.pageSize==200 }">selected</c:if>>200</option>
			</select>
			<span>条，共${page.totalCount}条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="${page.totalCount }" numPerPage="${page.pageSize}" pageNumShown="5" currentPage="${page.pageNo}"></div>

	</div>
</div>